using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using stringconversions;

namespace stringconversions.tests
{
    [TestFixture]
    public class test_ToDictionary
    {
        [Test]
        public void for_several_settings()
        {
            var dict = StringConversions.ToDictionary("a=1;b=2");

            Assert.AreEqual(new Dictionary<string, string>{{"a", "1"}, {"b", "2"}}, dict);
        }


        [Test]
        public void with_ext_method()
        {
            Assert.AreEqual(new Dictionary<string, string> { { "a", "1" }, { "b", "2" } },
                            "a=1;b=2".ToDictionary());
        }


        [Test]
        public void for_several_settings_with_EBC()
        {
            var dict = StringConversionsEBC.ToDictionary("a=1;b=2;");

            Assert.AreEqual(new Dictionary<string, string> { { "a", "1" }, { "b", "2" } }, dict);
        }
    }
}